package com.lw.common.timer;

import net.javacrumbs.shedlock.spring.annotation.EnableSchedulerLock;
import net.javacrumbs.shedlock.spring.annotation.SchedulerLock;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


/**
 * todo 经典案例
 * 定时器
 * by lw on 二〇二四年八月四日 12:28:41
 */
@Component
public class SimpleTimer {

//    @Scheduled(cron = "0/2 * * * * ?")
//    @SchedulerLock(name = "scheduledTaskName", lockAtLeastFor = "PT0S", lockAtMostFor = "PT1S")//默认的最大锁定时间，可以根据需要赋值，其中S为秒，M为分钟，H为小时，D为天，PT为ISO-8601期限格式
//    public void test() {
//        System.out.println("=============");
//    }
}
